/*
 * @Descripttion: 
 * @Date: 2021-04-18 16:34:59
 * @LastEditors: sueRimn
 * @LastEditTime: 2021-06-09 16:47:47
 * @Author: 作者:刘洋(L13831467435@163.com)
 */
/*
 * 列表搜索的 mixin
 */
import request from './server'

/* eslint-disable */
export const listSearch = {
  data() {
    return {
      // 加载中
      loading: false,
    }
  },
  methods: {
    /*
     * 发送请求
     */
    sendReq(params, callback) {
      let self = this
      console.log('请求地址', params.url)
      console.log('请求参数', params.data)
      request({
        method: params.method || 'POST',
        url: params.url,
        data: params.data || {},
        withCredentials: true,
        headers: {
          'Content-Type': params.contentType || 'application/json;charset=utf-8'
        }
      }).then((res) => {
        console.log('响应值', res)
        if (res && res.data) {
          callback && callback(res.data)
        }
      }, (error) => {
        console.log(error)
      })
    }
  }
}
